<%@ page import="java.util.List" %>
<%@ page import="top.yinhe.study.javawebjdbc.entity.TbMovie" %>
<%@ page import="top.yinhe.study.javawebjdbc.dao.TbMovieDAO" %><%--
  Created by IntelliJ IDEA.
  User: 巫和勇
  Date: 2024/5/28
  Time: 14:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="../lid/bootstarp.min.css">
</head>
<body>
<%
    List<TbMovie> list = TbMovieDAO.query();
%>


<div style="padding: 1rem;">
    <div>
    <a class="btn btn-primary" href="inesert.jsp">发布电影信息</a>
    </div>
    <div>电影列表</div>
<table class="table table-hover table-striped">

    <thead>
    <tr class="text-bg-secondary">
    <th>编号</th>
    <th>电影名称</th>
    <th>电影简介</th>
    <th>电影评分</th>
    <th>上映时间</th>
    <th>操作</th>
    </tr>
    </thead>

    <tbody>
    <%
        for (TbMovie movie : list) {
    %>
    <tr>
        <td><%=movie.getId()%>
        </td>
        <td><%=movie.getMovie()%>
        </td>
        <td><%=movie.getInfo()%>
        </td>
        <td><%=movie.getScore()%>
        </td>
        <td><%=movie.getCreated()%>
        </td>
        <td>
            <a href="delete.jsp?id">删除</a>
        </td>
    </tr>

    <%
        }
    %>
    </tbody>


</table>
</div>

<script src="../lid/bootstarp.min.js"></script>
</body>
</html>
